package com.yujianweb.oop;

public class TestComponet {
}

class Person2{
    String name;
    int height;
    public void rest(){
        System.out.println("休息");
    }
}

class Student2 /*extends Person*/ {
    Person2 p2 = new Person2();

    String major;   //专业

    public void study(){
        p2.rest();
        System.out.println(this.p2.name);
        System.out.println("学习");
    }

    public Student2(String name, int height, String major){
        this.p2.name = name;
        this.p2.height = height;

        this.major = major;
    }
}
